package com.sservice.model.dao;

import com.sservice.model.entity.AdvanceReceipt;
import com.sservice.model.vo.AdvanceReceiptVo;

import java.util.List;

public interface AdvanceReceiptMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(AdvanceReceipt record);

    int insertSelective(AdvanceReceipt record);

    AdvanceReceipt selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(AdvanceReceipt record);

    int updateByPrimaryKey(AdvanceReceipt record);

    /**
     * 符合查询条件统计
     *
     * @param record 查询条件
     * @return
     */
    int queryCount(AdvanceReceiptVo record);

    /**
     * 符合查询条件的AdvanceReceiptVo
     *
     * @param record 查询条件
     * @return
     */
    List<AdvanceReceiptVo> queryByPage(AdvanceReceiptVo record);

    int countBy(AdvanceReceiptVo record);

    List<AdvanceReceiptVo> queryBy(AdvanceReceiptVo record);

    /**
     * 截止目前，当前预收款单量
     *
     * @return
     */
    int queryCurrentDayCount(AdvanceReceipt ar);

    String queryCurrentDayMaxNo(AdvanceReceipt ar);

    /***
     * 查询客户预收款单
     * @param record
     * @return
     */
    List<AdvanceReceiptVo> queryByClienteleId(AdvanceReceiptVo record);

    //    <!--按发货单查询客户往来对账-->
    List<AdvanceReceiptVo> queryClienteleBill(AdvanceReceiptVo record);

    int countClienteleBill(AdvanceReceiptVo record);// 统计

    /**
     * 批量付款更新
     *
     * @param record
     * @return
     */
    int updateAdvanceReceiptInBatch(List<AdvanceReceipt> record);

    /**
     * 核算锁定
     *
     * @param record
     * @return
     */
    int lockAdvanceReceiptInBatch(List<AdvanceReceipt> record);

    /***
     * 释放锁定
     * @param record
     * @return
     */
    int releaseLockedAdvanceBill(AdvanceReceipt record);

    /**
     * 批量付款核算、审核订单
     *
     * @param record
     * @return
     */
    int payByLockedInBatch(AdvanceReceiptVo record);
}